import java.util.Arrays;
import java.util.Scanner;

public class test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();//队伍数量
        int[] nums = new int[3*n];
        for (int i = 0; i < nums.length; i++) {
            nums[i] = in.nextInt();
        }
        System.out.println(getResult(nums,n));
    }
    public static int getResult(int[] nums,int n){
        Arrays.sort(nums); //先排序
        int max = 0;
        int left=0,right= nums.length-1;

        for (int i = 0; i < n; i++) {
            left++;//最小
            right--;//最大
            max += nums[right];
            right--;
        }
        return max;
    }
}
